#include<iostream>
#include<cstdio>
using namespace std;
int w[30][30][30] = { 0 };
int fun(int a, int b, int c)
{
	if (a <= 0 || b <= 0 || c <= 0) {
		return 1;
	}
	if (a > 20 || b > 20 || c > 20) {
		return fun(20, 20, 20);
	}
	if (w[a][b][c]) {
		return w[a][b][c];
	}
	if (a < b && b < c) {
		 w[a][b][c] = fun(a, b, c - 1) + fun(a, b - 1, c - 1)
			- fun(a, b - 1, c);
	}
	else {
		 w[a][b][c] = fun(a - 1, b, c) + fun(a - 1, b - 1, c)
			+ fun(a - 1, b, c - 1) - fun(a - 1, b - 1, c - 1);
	}
	return w[a][b][c];
}
int main()
{
	int a, b, c;
	while (cin >> a >> b >> c) {
		if (a == -1 && b == -1 && c == -1) {
			break;
		}
		printf("w(%d, %d, %d) = %d\n", a, b, c, fun(a, b, c));
	}
	return 0;
}